package cn.lixin.hrm.receiver;

import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class Receiver {
    //定义邮件的队列名字
    public static final String QUEUE_NAME_EMAIL = "queue_name_email";
    //定义短信的队列名字
    public static final String QUEUE_NAME_SMS = "queue_name_SMS";
    //站内信队列
    public static final String QUEUE_NAME_SYSTEM_MESSAGE = "queue_name_system_message";


    @RabbitListener(queues = QUEUE_NAME_SMS)
    public void sendSMS(String msg, Message message, Channel channel){
        String MSS = "亲爱的用户，我们课程【"+msg+"】课程已经上线，赶紧来报名吧";
        System.out.println(MSS);
    }

    @RabbitListener(queues = QUEUE_NAME_EMAIL)
    public void sendEamil(String msg, Message message, Channel channel){
        String MSS = "亲爱的用户，我们课程【"+msg+"】课程已经上线，赶紧来报名吧";
        System.out.println(MSS);
    }

    @RabbitListener(queues = QUEUE_NAME_SYSTEM_MESSAGE)
    public void sendSystemMessage(String msg, Message message, Channel channel){
        String MSS = "亲爱的用户，我们课程【"+msg+"】课程已经上线，赶紧来报名吧";
        System.out.println(MSS);
    }

}
